webpackJsonp([15],{

/***/ 0:
/***/ function(module, exports, __webpack_require__) {

	var url = __webpack_require__(10);
	var template = __webpack_require__(11);
	var main = __webpack_require__(13);
	var form = __webpack_require__(20);
	var module = __webpack_require__(21);
	//模板配置
	var tplArr = [];
	var modalTpl = __webpack_require__(18);
	var personalTpl = __webpack_require__(24);
	tplArr['modal'] = template.compile(modalTpl.replace(/^\s*|\s*$/g, ""));
	tplArr['personal'] = template.compile(personalTpl.replace(/^\s*|\s*$/g, ""));

	function Index() {
	    _this = this;
	    this.main = function () {
	        main.event(this, 'tap', 'i-click');
	        this.init();
	    };

	    /**
	     * @param  {string} page "come from which page"
	     */
	    this.getContent = function (page) {
	        var baseUrl = _this.baseUrl;
	        var data = {
	            tType: "content"
	        };

	        //个人信息
	        var data_headgrid = {
	            tType: "headgrid",
	            image: "",
	            title: "Golan Yao",
	            tag: "超级粉丝"
	        };
	        //积分
	        var data_account = {
	            tType: "account",
	            key: "当前积分",
	            val: "1200",
	            name: "去积分商城"
	        };
	        //超链接列表
	        var data_arrlist = {
	            tType: "arrlist",
	            dataList: [{
	                name: "我的优惠券",
	                link: ""
	            }, {
	                name: "我收藏的商品",
	                link: ""
	            }, {
	                name: "我的收货地址",
	                link: ""
	            }]
	        };
	        //申请加入说明
	        var data_partner = {
	            tType: "partner",
	            title: "恭喜您！您已成为【超级粉丝】有机会成为【虚拟店员】",
	            description: "虚拟店员可获得虚拟店员专享二维码，享有8折拿货。",
	            link: "javascript:;",
	            fun: 'i-click="showRules"',
	            name: "大家乐会员规则"
	        };
	        //我的订单
	        var data_tabblock = {
	            tType: "tabblock",
	            title: "我的订单",
	            baseUrl: baseUrl,
	            dataList: [{
	                image: "order_1.jpg",
	                name: "全部订单",
	                click: 'jump1',
	                cornernum: ""
	            }, {
	                image: "order_2.jpg",
	                name: "待付款",
	                click: 'jump2',
	                cornernum: ""
	            }, {
	                image: "order_3.jpg",
	                name: "代收货",
	                click: 'jump3',
	                cornernum: ""
	            }, {
	                image: "order_4.jpg",
	                name: "待评价",
	                click: 'jump4',
	                cornernum: ""
	            }, {
	                image: "order_5.jpg",
	                name: "退换货",
	                click: 'jump5',
	                cornernum: ""
	            }]
	        };

	        main.post(url.clerOpenidkSingle, {}, function (res) {
	            var ret = res.data;
	            data_headgrid.title = ret.clerk_name;
	            if (ret.integral == null) {
	                data_account.val = 0;
	            }
	            if (ret.status == 1) {
	                data_headgrid.tag = "加盟商";
	            } else if (ret.status == 2) {
	                data_headgrid.tag = "店长";
	            } else if (ret.status == 3) {
	                data_headgrid.tag = "店员";
	            } else if (ret.status == 4) {
	                data_headgrid.tag = "门店合伙人";
	            } else if (ret.status == 5) {
	                data_headgrid.tag = "普通合伙人";
	            } else if (ret.status == 6) {
	                data_headgrid.tag = "粉丝";
	            }

	            switch (page) {
	                case "process":
	                    //普通合伙人
	                    data_headgrid.tag = "普通合伙人";
	                    data_partner.title = "您已成为【普通合伙人】有机会成为【门店合伙人】";
	                    data_partner.description = "虚拟店员可获得虚拟店员专享二维码，享有8折拿货。";
	                    data.headgrid = module.getModule(data_headgrid, "headgrid");
	                    data.tabblock = module.getModule(data_tabblock, "tabblock");
	                    data.account = module.getModule(data_account, "account");
	                    data.arrlist = module.getModule(data_arrlist, "arrlist");
	                    data.partner = module.getModule(data_partner, "partner");
	                    data.btnName = "申请成为虚拟店员";
	                    data.btnClick = "";
	                    break;

	                case "storepartner":
	                    //门店合伙人          
	                    data_headgrid.tag = "门店合伙人";
	                    data.headgrid = module.getModule(data_headgrid, "headgrid");
	                    data.tabblock = module.getModule(data_tabblock, "tabblock");
	                    data.account = module.getModule(data_account, "account");
	                    data.arrlist = module.getModule(data_arrlist, "arrlist");
	                    break;

	                case "clerkmember":
	                    //店员    
	                    data_headgrid.tag = "店员";
	                    data.headgrid = module.getModule(data_headgrid, "headgrid");
	                    data.tabblock = module.getModule(data_tabblock, "tabblock");
	                    data.account = module.getModule(data_account, "account");
	                    data.arrlist = module.getModule(data_arrlist, "arrlist");
	                    break;

	                case "clerkmaster":
	                    //店长    
	                    data_headgrid.tag = "店长";
	                    data.headgrid = module.getModule(data_headgrid, "headgrid");
	                    data.tabblock = module.getModule(data_tabblock, "tabblock");
	                    data.account = module.getModule(data_account, "account");
	                    data.arrlist = module.getModule(data_arrlist, "arrlist");
	                    break;

	                case "visual":
	                    data_headgrid.tag = "虚拟店员";
	                    // data_headgrid.qrcode="http://placeholder.qiniudn.com/100x100";
	                    // data_headgrid.qrlink="";
	                    data_arrlist = {
	                        tType: "arrlist",
	                        dataList: [{
	                            name: "订单管理",
	                            link: ""
	                        }, {
	                            name: "我的优惠券",
	                            link: ""
	                        }, {
	                            name: "粉丝订单",
	                            link: ""
	                        }, {
	                            name: "我的佣金",
	                            link: ""
	                        }, {
	                            name: "我收藏的商品",
	                            link: ""
	                        }, {
	                            name: "我的收货地址",
	                            link: ""
	                        }]
	                    };
	                    data_partner = {
	                        tType: "partner",
	                        title: "恭喜您！您满足条件，有机会申请成为【品牌大使】",
	                        description: "品牌大使可获得品牌大使专享二维码，享有65折拿货。",
	                        link: "",
	                        name: "大家乐会员规则"
	                    };
	                    data.headgrid = module.getModule(data_headgrid, "headgrid");
	                    data.tabblock = module.getModule(data_tabblock, "tabblock");
	                    data.arrlist = module.getModule(data_arrlist, "arrlist");
	                    data.partner = module.getModule(data_partner, "partner");
	                    data.btnName = "申请成为品牌大使";
	                    data.btnClick = "";
	                    break;

	                case "clerkmember":

	                    data_headgrid.tag = "虚拟店员";
	                    // data_headgrid.qrcode="http://placeholder.qiniudn.com/100x100";
	                    // data_headgrid.qrlink="";
	                    data_arrlist = {
	                        tType: "arrlist",
	                        dataList: [{
	                            name: "我的优惠券",
	                            link: ""
	                        }, {
	                            name: "粉丝订单",
	                            link: ""
	                        }, {
	                            name: "我的佣金",
	                            link: ""
	                        }, {
	                            name: "我收藏的商品",
	                            link: ""
	                        }, {
	                            name: "我的收货地址",
	                            link: ""
	                        }]
	                    };
	                    data_partner = {
	                        tType: "partner",
	                        title: "恭喜您！您满足条件，有机会申请成为【品牌大使】",
	                        description: "品牌大使可获得品牌大使专享二维码，享有65折拿货。",
	                        link: "",
	                        name: "大家乐会员规则"
	                    };
	                    data.headgrid = module.getModule(data_headgrid, "headgrid");
	                    data.tabblock = module.getModule(data_tabblock, "tabblock");
	                    data.arrlist = module.getModule(data_arrlist, "arrlist");
	                    data.partner = module.getModule(data_partner, "partner");
	                    data.btnName = "申请成为品牌大使";
	                    data.btnClick = "";
	                    break;

	                case "clerkmaster":
	                    data_headgrid.tag = "店长";
	                    // data_headgrid.qrcode="http://placeholder.qiniudn.com/100x100";
	                    // data_headgrid.qrlink="";
	                    data_arrlist = {
	                        tType: "arrlist",
	                        dataList: [{
	                            name: "订单管理",
	                            link: ""
	                        }, {
	                            name: "我的优惠券",
	                            link: ""
	                        }, {
	                            name: "粉丝订单",
	                            link: ""
	                        }, {
	                            name: "我的佣金",
	                            link: ""
	                        }, {
	                            name: "我收藏的商品",
	                            link: ""
	                        }, {
	                            name: "我的收货地址",
	                            link: ""
	                        }]
	                    };
	                    data.headgrid = module.getModule(data_headgrid, "headgrid");
	                    data.tabblock = module.getModule(data_tabblock, "tabblock");
	                    data.arrlist = module.getModule(data_arrlist, "arrlist");
	                    data.account = module.getModule(data_account, "account");
	                    break;

	                case "alliance":
	                    data_headgrid.tag = "";
	                    data.headgrid = module.getModule(data_headgrid, "headgrid");
	                    data.tabblock = module.getModule(data_tabblock, "tabblock");
	                    data.arrlist = module.getModule(data_arrlist, "arrlist");
	                    data.account = module.getModule(data_account, "account");
	                    break;
	            }
	            $(".content").html(tplArr['personal'](data));
	        });
	    };
	    this.showRules = function () {
	        main.botActionsheet({
	            "content": "大家乐规则"
	        });
	    };
	    this.jump1 = function () {
	        window.location.href = url.orderManager;
	    };
	    this.jump2 = function () {
	        window.location.href = url.orderManager + '?order_status=pay_0';
	    };
	    this.jump3 = function () {
	        window.location.href = url.orderManager + '?order_status=shipping_1';
	    };
	    this.jump4 = function () {
	        window.location.href = url.orderManager + '?order_status=assess_1';
	    };
	    this.jump5 = function () {
	        window.location.href = url.orderManager + '?order_status=return_4';
	    };
	    //inital page
	    this.init = function () {
	        this.page = _page;
	        // this.openid=_openid;
	        this.baseUrl = url.baseImageUrl;

	        this.getContent(this.page);
	    };
	    return this.main();
	};

	var index = new Index();

/***/ },

/***/ 20:
/***/ function(module, exports, __webpack_require__) {

	var url = __webpack_require__(10);
	var template = __webpack_require__(12);
	var main = __webpack_require__(13);
	var modalTpl = __webpack_require__(18);

	//模板配置
	var tplArr = [];
	template.config('escape', false);
	tplArr['modal'] = template.compile(modalTpl.replace(/^\s*|\s*$/g, ""));

	//获取验证码
	function getCode(_dom, url, id) {
	  var _mobile = $('input[name="mobile"]').val();
	  var code = $('input[name="code"]').val();
	  if (_dom.text() != '获取验证码') {
	    return false;
	  }
	  if (_mobile == "") {
	    jsAlert('请输入手机号码');
	  } else if (/^1[3|4|5|7|8]\d{9}$/.test(_mobile) == false) {
	    jsAlert('手机号码格式有误');
	  } else {
	    _dom.text("校验中");
	    $.post(url, { "user_id": id, "mobile": _mobile }, function (json, textStatus) {
	      _json = json;
	      if (_json.code == 1) {
	        var tm = 60;
	        var tmr = setInterval(function () {
	          tm--;
	          if (tm > 0) {
	            _dom.text(tm + "秒");
	          } else {
	            _dom.text('获取验证码');
	            clearInterval(tmr);
	            tm = 60;
	            //_dom.attr('onclick','join.getCode()')
	          }
	        }, 1000);

	        jsAlert('验证码已发送');
	      } else if (_json.code == 2) {
	        jsAlert(_json.data);
	        _dom.text('获取验证码');
	      } else if (_json.code == 200) {
	        jsAlert(_json.data);
	        _dom.text('获取验证码');
	      }
	    }, 'json');
	  }
	}
	//弹窗
	function jsAlert(text, Fun) {
	  if (!Fun) {
	    Fun = 'm-click="modalAlertClose"';
	  }
	  var data = {
	    "type": "1",
	    "ico": 'warn',
	    "text": text,
	    "Callback": Fun
	  };
	  $('body').append(tplArr['modal'](data));
	}
	//表单数据整理
	// function ajaxSubmit_o(obj,module,but) {

	//   //var url = $(obj).attr("action") || window.location.href;
	//   var callback_name = $(obj).attr("callback");
	//   var url = $(obj).attr("action");
	//   var data = {};
	//   var ipts = {};
	//   $('input[name],textarea[name],select[name]',obj).each(function(item){
	//       var name = $(this).attr('name');
	//       var value = $(this).val();
	//       var ipt = $(this).attr('ipt');
	//       var isArray = /\[\]$/;
	//       if(isArray.test(name)){
	//           if(!data[name]){data[name]=[]}
	//           if(!ipts[name]){ipts[name]=[]}
	//           data[name].push(value);
	//           ipts[name].push(value,ipt);
	//       }else{
	//           data[name] = value;
	//           ipts[name] = [value,ipt];
	//       }
	//   });

	//   if(!yzForm(ipts)){return false;}
	//   but.attr('isSubmit','false').text('提交中...');
	//   $.ajax({
	//       url: url,
	//       type: "get",
	//       data: data,
	//       dataType: "json",
	//       success: function(ret){
	//           //if(ret.sms_success == "1"){
	//               //if(isNotEmpty(callback)) {
	//                 //_this.id = ret.success_id;
	//                 //jsConfirm('提示','请您确认所有填写的信息准确无误！',callback_name);
	//                 module[callback_name](ret);
	//               //}
	//           //}else if(ret.sms_success == "0"){
	//               //jsAlert("验证码错误");
	//           //}
	//       },
	//       error:function(ret){

	//       }
	//   });
	// }
	//表单数据整理
	function ajaxSubmit(obj, module, but) {
	  //console.info(module)
	  var but_val = but.html();
	  if (but_val == "提交中...") {
	    console.info("频次太快");
	    return false;
	  }
	  //var url = $(obj).attr("action") || window.location.href;
	  var callback_name = $(obj).attr("callback");
	  var url = $(obj).attr("action");
	  var formtype = $(obj).attr("f-type");
	  var data = {};
	  var ipts = {};
	  $('input[name],textarea[name],select[name]', obj).each(function (item) {
	    var name = $(this).attr('name');
	    var value = $(this).val();
	    var ipt = $(this).attr('ipt');
	    var isArray = /\[\]$/;
	    if (isArray.test(name)) {
	      if (!data[name]) {
	        data[name] = [];
	      }
	      if (!ipts[name]) {
	        ipts[name] = [];
	      }
	      data[name].push(value);
	      ipts[name].push(value, ipt);
	    } else {
	      data[name] = value;
	      ipts[name] = [value, ipt];
	    }
	  });

	  if ($("input[name='is_default']:checked").length == 1) {
	    data.is_default = 1;
	  } else {
	    data.is_default = 0;
	  }

	  if (!yzForm(ipts)) {
	    return false;
	  }
	  but.attr('isSubmit', 'false').html('提交中...');

	  //console.info(data)
	  data.openid = openid;
	  // $("body").html(data.serverId);
	  $.ajax({
	    url: url, //+"?openid_test=ojtKJjq93sF3dOoz4lA12MrxtcUk",
	    type: "post",
	    data: data,
	    dataType: "json",
	    success: function (ret) {
	      // console.info(ret)
	      //if(ret.sms_success == "1"){
	      //if(isNotEmpty(callback)) {
	      //_this.id = ret.success_id;
	      //jsConfirm('提示','请您确认所有填写的信息准确无误！',callback_name);
	      module[callback_name](ret);
	      but.html(but_val);
	      //}
	      //}else if(ret.sms_success == "0"){
	      //jsAlert("验证码错误");
	      //}
	    },
	    error: function (ret) {
	      but.html(but_val);
	      console.info(ret);
	    }
	  });
	}
	//方法验证
	function yzForm(data) {
	  var Ctrue = true;
	  var hour = $('select[name="sendplan_hour"]').val();
	  for (ipt in data) {
	    if (data[ipt][1] == 'true') {
	      continue;
	    }
	    switch (ipt) {

	      case 'name':
	        if (data[ipt][0] == "") {
	          isCtrue('请输入名字');return false;
	        }
	        break;

	      case 'mobile':
	        if (data[ipt][0] == "") {
	          isCtrue('请输入手机号码');return false;
	        } else if (/^1[3|4|5|7|8]\d{9}$/.test(data[ipt][0]) == false) {
	          isCtrue('手机号码格式有误');return false;
	        }
	        break;

	      case 'address':
	        if (data[ipt][0] == "") {
	          isCtrue('请输入详细地址');return false;
	        }
	        break;
	      case 'shipping_id':
	        if (data[ipt][0] == "") {
	          isCtrue('请选择物流');return false;
	        }
	        break;
	      case 'shipping_number':
	        if (data[ipt][0] == "") {
	          isCtrue('请填写物流单号');return false;
	        }
	        break;

	      // case 'is_default':
	      //    if(data[ipt][0]==""){isCtrue('请选择');return false;}
	      // break;
	    }
	  }
	  function isCtrue(text) {
	    Ctrue = false;
	    main.alert({
	      "title": "提示",
	      "content": text
	    });
	  };
	  return Ctrue;
	}

	exports.getCode = getCode;
	exports.jsAlert = jsAlert;
	exports.ajaxSubmit = ajaxSubmit;
	exports.yzForm = yzForm;

/***/ },

/***/ 24:
/***/ function(module, exports) {

	module.exports = "{{if tType== \"content\"}}\n<!-- 模块：id -->\n<div class=\"ui-container content\">\n\t{{if !!headgrid}}\n\t\t{{headgrid}}\n\t{{/if}}\n\n\t{{if !!tabblock}}\n\t\t{{tabblock}}\n\t{{/if}}\n\n\t{{if !!account}}\n\t\t{{account}}\n\t{{/if}}\n\n\t{{if !!arrlist}}\n\t\t{{arrlist}}\n\t{{/if}}\n\n\t{{if !!partner}}\n\t\t{{partner}}\n\t{{/if}}\n\n\t{{if !!btnName}}\n\t<div class=\"ui-btn-wrap\">        \n\t\t<a href=\"javascript:;\" {{btnClick}} class=\"ui-btn-pink ui-btn-lg\">{{btnName}}</a>\n    </div>\n\t{{/if}}\n</div>\n{{/if}}\n"

/***/ }

});